from sqlalchemy import Column, Integer, String, \
    Text, ForeignKey, SmallInteger
from sqlalchemy.orm import relationship
from datetime import datetime


from app.models import Base
from app import create_session

class Tag(Base):
    id = Column(Integer, primary_key=True)  # 记录id
    name = Column(String(100), unique=True) # 标题

    movies = relationship("Movie", backref='tag')  # 关联查询 tag表